package cn.gbase.jiangsu.data.transfer;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Encoding;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Modules;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.SetupBy;
import org.nutz.mvc.ioc.provider.ComboIocProvider;

import cn.gbase.jiangsu.data.transfer.job.MainJob;
import cn.gbase.jiangsu.data.transfer.service.CompanyCountService;

@Ok("json")
@Fail("jsp:/error")
@IocBy(type = ComboIocProvider.class, args = { "*org.nutz.ioc.loader.json.JsonLoader", "/datasource.json",
		"*org.nutz.ioc.loader.annotation.AnnotationIocLoader", "cn.gbase.jiangsu.data.transfer" })
@Filters(@By(type = CheckSession.class))
@Encoding(input = "UTF-8", output = "UTF-8")
@Modules(value = { MainModule.class }, scanPackage = true)
@SetupBy(MainJob.class)
public class MainModule {
	@Inject
	protected static CompanyCountService companyCountService;
	/**
	 * 跳转到首页.
	 */
	@At("/main")
	@Ok("jsp:/main")
	public void toMainPage() {
		int count = companyCountService.count();
		System.out.println(count);
	}

	/**
	 * 跳转到供货商首页.
	 */
	@At("/supplierMain")
	@Ok("jsp:/supplierMain")
	public void toSupplierMainPage() {
	}

	/**
	 * 跳转到物业首页.
	 */
	@At("/companyMain")
	@Ok("jsp:/companyMain")
	public void toCompanyMainPage() {
	}
}
